<template>
  <v-data-table :headers="headers" :items="books" hide-default-footer :items-per-page="5" class="elevation-1">
    <template v-slot:item.book_type="{ item }">
      {{ item.book_type }}
    </template>
    <template v-slot:item.price="{ item }">
      {{ item.price }}
    </template>
    <template v-slot:item.book_stock="{ item }">
      {{ item.book_stock }}
    </template>
    <template v-slot:item.borrow_status="{ item }">
      {{ item.borrow_status }}
    </template>
  </v-data-table>
</template>

<script>
export default {
  props: {
    books: {
      type: Array,
    },
  },
  data() {
    return {
      headers: [
        { text: "书名", value: "book_name" },
        { text: "作者", value: "author" },
        { text: "出版社", value: "publisher" },
        { text: "出版时间", value: "publish_time" },
        { text: "ISBN", value: "isbn" },
        { text: "书籍类型", value: "book_type" },
        { text: "价格", value: "price" },
        { text: "库存", value: "book_stock" },
        { text: "借出状态", value: "borrow_status" },
      ],
      
    };
  },
};
</script>
